package case1.factory;

import case1.Quackable;
import case1.decorator.QuackCounter;
import case1.duck.DuckCall;
import case1.duck.MallardDuck;
import case1.duck.RedheadDuck;
import case1.duck.RubberDuck;

/**
 * description:
 * 鸭鸣计数器工厂
 * @author Yuanml on 2020/10/30 14:41
 */
public class CountingDuckFactory extends AbstractDuckFactory {
    @Override
    public Quackable createMallardDuck() {
        return new QuackCounter(new MallardDuck());
    }

    @Override
    public Quackable createRedheadDuck() {
        return new QuackCounter(new RedheadDuck());
    }

    @Override
    public Quackable createDuckCall() {
        return new QuackCounter(new DuckCall());
    }

    @Override
    public Quackable createRubberDuck() {
        return new QuackCounter(new RubberDuck());
    }
}
